package com.example.seckill.application.service;

import com.example.seckill.domain.model.Product;
import org.springframework.stereotype.Service;

/**
 * @author Martin
 */

public interface StockService {
    /**
     * 获取商品库存
     * @param product
     * @return
     */
    int getStock(Product product);

    /**
     * 减少商品库存
     * @param product
     * @param quantity
     * @return
     */
    void reduceStock(Product product, int quantity);
    void reduceStockV2(Product product, int quantity);

    boolean increaseStock(Long productId, int i);
}

